package newapi;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Locale;

public class Test1 {
    public static void main(String[] args) {
        LocalDate ld = LocalDate.now();

        int year = ld.getYear();
        int month = ld.getMonthValue();
        int day = ld.getDayOfMonth();
        System.out.println(year+" "+month+" "+day);


        //当年的第几天
        int dayofyear = ld.getDayOfYear();
        System.out.println(dayofyear);

        //星期
        System.out.println(ld.getDayOfWeek());
        System.out.println(ld.getDayOfWeek().getValue());

        System.out.println(ld.getMonth());
        System.out.println(ld.getMonth().getValue());


        LocalTime lt = LocalTime.now();
        int hour = lt.getHour();
        int minute = lt.getMinute();
        int seconds = lt.getSecond();
        int nanonscconds = lt.getNano();
        System.out.println(hour+" "+minute+" "+seconds+" "+nanonscconds);

    }
}
